﻿@addTagHelper *, WebVella.Erp.Plugins.Core
@addTagHelper *, WebVella.Erp.Web
@addTagHelper *, WebVella.TagHelpers
@using WebVella.Erp.Web.Utils;
@using WebVella.Erp.Web.Components;
@using WebVella.TagHelpers.Models;
@using WebVella.Erp.Web;
@{
	var options = (PcButton.PcButtonOptions)ViewBag.Options;
	var cssSizeOptions = (List<WvSelectOption>)ViewBag.CssSize;
	var colorOptions = (List<WvSelectOption>)ViewBag.ColorOptions;
	var typeOptions = (List<WvSelectOption>)ViewBag.TypeOptions;
	var erpRequest = (ErpRequestContext)ViewBag.RequestContext;
}


<wv-row>
	<wv-column span="4">
		<wv-field-select name="type" label-text="Type" value="@((int)options.Type)" options="typeOptions" required="true"></wv-field-select>
	</wv-column>
	<wv-column span="4">
		<wv-field-datasource name="text" label-text="Button text" value="@options.Text" page-id="erpRequest.Page.Id"></wv-field-datasource>
	</wv-column>
	<wv-column span="4">
		<wv-field-select name="color" label-text="Color" value="@((int)options.Color)" options="colorOptions" required="true"></wv-field-select>
	</wv-column>
</wv-row>
<wv-row>
	<wv-column span="4">
		<wv-field-select name="size" label-text="Size" value="@((int)options.Size)" options="cssSizeOptions" required="true"></wv-field-select>
	</wv-column>
	<wv-column span="4">
		<wv-field-datasource name="class" label-text="Css class" value="@options.Class" page-id="erpRequest.Page.Id"></wv-field-datasource>
	</wv-column>
	<wv-column span="4">
		<wv-field-text name="id" label-text="Id" value="@options.Id"></wv-field-text>
	</wv-column>
</wv-row>
<wv-row>
	<wv-column span="4">
		<wv-field-datasource name="icon_class" label-text="Icon class" value="@options.IconClass" page-id="erpRequest.Page.Id"></wv-field-datasource>
	</wv-column>
	<wv-column span="4">
		<wv-field-checkbox name="is_block" label-text="Width" value="@options.isBlock" text-true="display full width button"></wv-field-checkbox>
	</wv-column>
	<wv-column span="4">
		<wv-field-checkbox name="is_outline" label-text="Outline" value="@options.isOutline" text-true="outline button"></wv-field-checkbox>
	</wv-column>
</wv-row>

<wv-row>
	<wv-column span="4">
		<wv-field-checkbox name="icon_right" label-text="Icon on the right" value="@options.IconRight" text-true="render the icon on the right"></wv-field-checkbox>
	</wv-column>
	<wv-column span="4">
		<wv-field-checkbox name="is_active" label-text="Active" value="@options.isActive" text-true="active button"></wv-field-checkbox>
	</wv-column>
	<wv-column span="4">
		<wv-field-checkbox name="is_disabled" label-text="Disabled" value="@options.isDisabled" text-true="disabled button"></wv-field-checkbox>
	</wv-column>
</wv-row>
<wv-row>
	<wv-column span="4">
		<wv-field-datasource name="is_visible" label-text="Is Rendered" value="@options.IsVisible" page-id="erpRequest.Page.Id" placeholder="true"></wv-field-datasource>
	</wv-column>
	<wv-column span="8">
		<wv-field-datasource name="onclick" label-text="OnClick" value="@options.OnClick" page-id="erpRequest.Page.Id"></wv-field-datasource>
	</wv-column>
</wv-row>
<wv-row>
	<wv-column span="4">
		<wv-field-datasource page-id="erpRequest.Page.Id" name="href" label-text="Href (applied only for LinkAsButton type)" value="@options.Href"></wv-field-datasource>
	</wv-column>
	<wv-column span="4">
		<wv-field-checkbox name="new_tab" label-text="New tab" value="@options.NewTab" text-true="open link in new tab"></wv-field-checkbox>
	</wv-column>
	<wv-column span="4">
		<wv-field-text name="form" label-text="Submit form Id" value="@options.Form" description="applies only to type 'Submit' button"></wv-field-text>
	</wv-column>
</wv-row>